package yxj03;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class ObjectOutputStreamDemo {
    public static void main(String[] args) throws IOException {
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("D:\\Ccode\\java-se\\IOStream\\src\\oos.txt"));
        Student s = new Student("yxj",22);

        oos.writeObject(s);

        //此时内容读不懂，需要反序列化读
        oos.close();
    }
}
